#!/usr/bin/env python
# -*- coding: utf-8 -*-

from shared.helper import render_to_response
from documents.models import Item


def index(request):
    user = request.user
    new_items = None
    if user.is_authenticated():
        new_items = Item.objects.filter(datetime__gt = user.last_login)
    return render_to_response(request, 'shared/index.html', { 'new_items': new_items })

def http404(request):
    response = render_to_response(request, 'shared/404.html')
    response.status_code = 404
    return response

def http500(request):
    response = render_to_response(request, 'shared/500.html')
    response.status_code = 500
    return response